<?xml version="1.0" encoding="UTF-8"?>
<html>
    <head>
        <link type="text/css" rel="stylesheet" href="./css/template.css" />
        <link type="text/css" rel="stylesheet" href="./css/SyntaxHighlighter.css" />
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>BIRT : Eclipse become a report creation tool</title>
        <script language="javascript" src="./js/shInit.js" />
        <script language="javascript" src="./js/shCore.js" />
        <script language="javascript" src="./js/shBrushCpp.js" />
        <script language="javascript" src="./js/shBrushCSharp.js" />
        <script language="javascript" src="./js/shBrushCss.js" />
        <script language="javascript" src="./js/shBrushDelphi.js" />
        <script language="javascript" src="./js/shBrushJava.js" />
        <script language="javascript" src="./js/shBrushJScript.js" />
        <script language="javascript" src="./js/shBrushPhp.js" />
        <script language="javascript" src="./js/shBrushPython.js" />
        <script language="javascript" src="./js/shBrushRuby.js" />
        <script language="javascript" src="./js/shBrushSql.js" />
        <script language="javascript" src="./js/shBrushVb.js" />
        <script language="javascript" src="./js/shBrushXml.js" />
        <keywords>eclipse, birt, bo, actuate, reporting, reports</keywords>
        <author>Maxime VIALETTE</author>
    </head>
    <body>
        <div class="chapter">
            <h2>Introduction</h2>
            <p>
            	Many tools are already available on the decisional tools market like Business Object, Cognos, etc...
            	BIRT (Business Intelligence and Reporting Tools) permit to use Eclipse to write reports.
            	(
                <em>reporting</em>
                ).
                
                The BIRT strength is that it's an open source project (<a target="_blank" href="http://en.wikipedia.org/wiki/Eclipse_Public_License">EPL</a> License)
                 and this is an Eclipse plugin. The first version (1.0) of this project was released on november 2004. 
                 Since october 2007 version 2.2.1 is available.
            </p>
            <p>
            	Beside the Eclipse communauty, BIRT is also supported by the <a target="_blank" href="http://www.actuate.com">Actuate</a> 
            	society which is specialized in enterprise reporting applications for many years. 
            	Actuate release his own BIRT version with a technical support.
            </p>
            <p>
            	BIRT is composed of many modules. The two main modules are BIRT Designer 
            	and BIRT Engine using for rendering
			</p>
            <p>
            	The reports render might be obvious done by Eclise. But most of the time we would prefer 
            	host it on a Java EE web server thanks to a Web Application which is BIRT Viewer. 
            	This report strength is its dynamism which is very useful to know their account state, bills, 
            	charges or stocks for instance in a	snapshot way.
           </p>
           
            <p>
            	In most of cases, this <em>reporting</em> is base on a database bun can also works with XML files, files 
            	(like CSV or TXT Files for instance) or a script returning datas. If we would have static reports, it would 
            	be obviously possible. The use of BIRT Viewer is not mandatory : HTML or PDF export must be enough.
            </p>
        </div>
        <div class="chapter">
            <h2>Installation</h2>
            <p>
            	BIRT can be installed in different way :
			</p>
            <ul>
            	<li>With the "All in one" version everything is already installed with Eclipse</li>
                <li>With a framework which has to be install on an existing Eclipse environment</li>
                <li>With the RCP Designer which is based on Eclipse RCP but this is only a report designer.</li>
            </ul>
            
            Version 2.2.1.1 of BIRT requires Eclipse 3.3, GEF 3.3 and EMF 2.3. For PDF export, the <a target="_blank" href="http://www.lowagie.com/iText/">iText</a> 
            API is required. You have to download the JDBC drivers you need according the database you want to use. In this 
            article we will use MySQL
            
        </div>
        <div class="chapter">
            <h2>Grip</h2>
            <p>The designer integrates a WYSIWYG editor based on Eclipse RCP. We will find perspectives and views principle well 
            known for Eclipse users. For those who don't know Eclipse or are not developers, don't worry, the use of it doesn't require 
            any line of code.</p>
            
            
            <p>The editor proposes you to contruct easily the model used to create you reports by a "Drag'n'drop" way very user friendly. 
            It is possible to create dynamic array, lists, graphics...</p>
            
            <p>BIRT integrates a full documentation by the "Cheat Sheets" view which is made of several sections by the way of several Eclipse plugins tutorials.</p>
        </div>
        <div class="chapter">
            <h2>Practical case</h2>
            <p>
            	In order to start your report creation, you'll have to create a new project by the "File" menu. Then choose "New" -> "Project..." -> "Business Intelligence and Reporting Tools" -> "Report Project". 
            	For those who don't know Eclipse, you have to know that you can create reports in every project types. You don't have to create a "Report Project". 
            	The creation of this sort of project is very recommended in order to keep a good organization. Eclipse will ask you if you want to use the "Report Design" perspective which 
            	allow you to have better menus for this type of project. Click on "Yes" and then right click on your project in the "Navigator" and choose "New" and finally "Report". 
            	A ".rptdesign" file just has been created. This is BIRT extension for report. The report creation assistant will ask you to choose what template you want to apply to your 
            	report. You can choose between the "Blank Report", "My First Report", "Simple Listing", "Grouped Listing", "Dual column Listing", "Chart Listing", "Dual Column Chart &amp; Listing", 
            	"Side by side Chart &amp; Listing". Here we will choose the "Blank Report" to start. You will be able to use quickly the others available models. 
            </p>
            
            <p>
            	First things to do is to create a datasource link. We will use MySQL so we have to define the database type, the connection string, the user, the password and the JDBC driver. 
            	Here's an example of the datasource creation assistant : <br><img src="./images/01-DS.jpg" />
            </p>
            <p>
            	We will use here a MySQL database so we have to get the corresponding driver. Once the datasource is created (you could have several datasources in the same report) you have to create 
            	DataSets thanks to the following assistant : <br><img src="./images/02-dataSetA.jpg" />
            </p>
            <p>
            	We won't detail all the features of BIRT but one of them which is very appreciate could be the fact to have the generate DataSet columns (use for instance for computed datas). 
            	SQL concepts are necessary to create your dataset including syntaxes or joins...
            </p>
            <p>
            	On the left side of the assistant window, you will find different options in order to personnalize this last : DataSource, Query, Ouput columns, Computed columns, Parameters, 
            	Filters, Property binding, Cache Preference, Preview Results.
            </p>
            
            <p>
            	"Data Source" and "Query" parts will allow you to come back to the precedent steps of the DataSet creation assistant. "Output Columns" part allow you to visualize your dataset 
            	columns return types and give them aliases or display names.</p>
            <p>
            	"Computed Columns" part is practical to make some calculation : <br><img src="./images/03-dataSetB.jpg" />
            </p>
            <p>
            	You can also choose to make your form dynamic in function to the inputs made by the user. It would be accessible by the "Parameters" or "Filter or "Property Binding" part. 
            	You just have to put your restriction operations in your SQL code but directly and easily thanks to the assistants.
            </p>
            <p>
            	Finally, a dataset preview would be proposed before integrate it in your report : <br><img src="./images/04-dataSetC.jpg" />
            </p>
            <p>
            	You could learn more about DataSets by creating "Join Data Set" which permit to regroup datas from different datasource types (Database or XML for instance).
            </p>
            <p>
            	The "Data Explorer" Eclipse view permits to obtain the Datasources & Datasets summary present in your project : <br><img src="./images/05-dataExplorer.jpg" />
            </p>
            <p>
            	"Body", "Report Parameters", "MasterPages", "Styles", "Embedded Images" & "Libraries" parts allow you to custom your reports. For instance you could apply a CSS style to your 
            	reports in order to make them homogeneous no matter their export format.
            </p>
            <p>
            	Thanks to this view you could drag'n'drop all the dynamic field one by one or the entire DataSet directly in the report editor. 
            	In this example, we will regroup our datas by their family name. Just use the "Insert Group" contextual menu on the "OrderDetails" DataSet under the "Layout" tab of the report editor : <br><img src="./images/06-group.jpg" />
            </p> 
         
            <p>
            	A group configuration assistant will permit you to define its comportment : the sens of regrouping to do, the field on which the dynamic consolidation takes place, the filters...
                <br><img src="./images/07-groupWizard.jpg" />
            </p>
            <p>
            	You could also vary your report render in function of the displayed values. In our example, I have chosen to change the font in a bold red when the quantity ordered 
            	is greater than 6. However you could dynamise your report by a stronger way : change borders, change the cell background color, change the font size ...
            	<br><img src="./images/08-higlight.jpg" />                
            </p>
            <p>
            	An assistant named "Expression Builder" permit to access BIRT features dedicated to dates, finance, sums, boolean tests and access also to Javascript features very useful to back 
            	up the current date, mathematics functions, string manipulation. For XML fans one of the report editor tabs named "XML Source" permit you to watch the definition of this last. 
            	In reality <em>.rptdesign</em> files are XML files analysed by the BIRT Engine and the BIRT Viewer in order to create the render in real time : <br><img src="./images/09-xml.jpg" />
            </p>
            <p>
            	For the moment we have seen how to display the DataSet content in the report by a very fast way. However several other layouts exists like : Dynamic text (link to a DataSet element), 
            	list, grid, graphics (2D, 3D) ... <br><img src="./images/10-palette.jpg" />
            </p>
            <p>
            	There is a lot of choice in graphics which are exportable in several formats : PNG, JPG, BMP and SVG. A graphic creation assistant permit to parameter in a very easy way : 
                <br><img src="./images/11-chartWizardA.jpg" />
            </p>
            <p>
            	Once you have chosen your graphic type and have made the DataSet link, the assistant will propose you a display of the result under the "Select Data" tab. 
            	You just have to specify the dynamic field which will be fix on the graphic axe in order to watch the render :  <br><img src="./images/12-selectData.jpg" />
            </p>
            <p>
            	Once the graphic definition done thanks to the assistant, you could come back to the "Layout" tab of the report editor in order to make your last changes on the different elements 
            	you want to change to finalize it : <br><img src="./images/13-layout.jpg" />
            </p>
            <p>
            	A trick to organize your report easier : use the palette of the "Grid" object to locate the elements in your report in the cells (tables, graphics ...). 
            	Always in the report editor, you could obtain the render of it thanks to the "Preview" tab : <br><img src="./images/14-preview.jpg" />
            </p>
            <p>
            	If you want to modify your graphic because you're not entirely satisfy of the display, you could come back at any time on the "Layout" tab in order to edit your report. 
            	When your report is finalize you could export it in HTML or PDF in the BIRT Viewer : <br><img src="./images/15-reportViewer.jpg" />
            </p>
            <p>
            	The advantage of the visualization in the BIRT Viewer is that you can have access to an index page like in a PDF report visualization. This option is available only if 
            	you have defined groups in your report and if it has a listing of many pages.
			</p>
        </div>
        <div class="chapter">
            <h2>Conclusion</h2>
            <p>
            	The reporting is a vital thing for the enterprises. But tools stay expansive or features limited when they are free. BIRT come with a lot of features which are very easy to 
            	implement. You could realize crossing reports of your project by a simple click on a cell of one of your array or on a graphic element in order to access another report.
			</p>
            <p>
            	This project is very reactive : language packs are available, PHP implementation has been realized, commercial tools integrates BIRT ...
            	To obtain complementary informations take a look on the project website : <a target="_blank" href="http://www.eclipse.org/birt">www.eclipse.org/birt</a>
            </p>
            <p>
            	Don't hesitate to go on the following websites to watch flash tutorials : 
            </p>
            <ul>
                <li>
                    <a target="_blank" href="http://download.eclipse.org/birt/downloads/examples/reports/2.1/tutorial/tutorial.html">http://download.eclipse.org/birt/downloads/examples/reports/2.1/tutorial/tutorial.html</a>
                </li>
                <li>
                    <a target="_blank" href="http://download.eclipse.org/birt/downloads/examples/misc/BIRT2.1Demo/EclipseDemo.html">http://download.eclipse.org/birt/downloads/examples/misc/BIRT2.1Demo/EclipseDemo.html</a>
                </li>
            </ul>
            
            	The project website is very full. You can find examples, documentation, a wiki... Thanks to the different API of BIRT you could integrate some report features in your web applications, 
            	your RCP clients, by command line ... Possibilities are endless.
        </div>
    </body>
</html>

